<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
    <head>
        <%@include file="../common/head.jspf" %>
    </head>

    <body class="sb-l-o sb-r-c admin-form theme-primary" data-menu="#menu_user" data-list="#li_user_list">

        <!-- 主体内容开始 -->
        <div id="main">

            <!--侧边导航栏-->
            <%@include file="../common/sidebar.jspf" %>

            <!-- Start: Content-Wrapper -->
            <section id="content_wrapper">

                <!-- 顶部导航 -->
                <header id="topbar">
                    <div class="topbar-left">
                        <ol class="breadcrumb">
                            <li class="crumb-active">
                                <span>软擎科技</span>
                            </li>
                            <li class="crumb-icon">
                                <a href="dashboard"><span class="glyphicon glyphicon-home"></span></a>
                            </li>
                            <li class="crumb-icon">
                                <a href="user/list">红包列表</a>
                            </li>
                            <!-- 当前页 -->
                            <c:choose>
                                <c:when test="${model != null}">
                                    <li class="crumb-trail">编辑红包</li>
                                    </c:when>
                                    <c:otherwise>
                                    <li class="crumb-trail">添加红包</li>
                                    </c:otherwise>
                                </c:choose>
                        </ol>
                    </div>
                    <div class="topbar-right">
                        <!-- 登录信息 -->
                        <%@include file="../common/session.jspf" %>
                    </div>
                </header>
                <!-- 顶部导航结束 -->

                <!-- 页面内容开始 -->
                <section id="content">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="mw500 mauto p10">
                                <c:choose>
                                    <c:when test="${model != null}">
                                        <h1 class="text-center text-muted-lighter mb20"><i class="fa fa-pencil-square-o mr5"></i>编辑红包</h1>
                                    </c:when>
                                    <c:otherwise>
                                        <h1 class="text-center text-muted-lighter mb20"><i class="fa fa-plus-square mr5"></i>添加红包</h1>
                                    </c:otherwise>
                                </c:choose>
                                <form class="form-horizontal mb10 mt20" role="form" id="couponForm">
                                    <div class="form-group mbn">
                                        <input type="hidden" class="form-control pull-right" name="id" id="id" value="${model}">
                                        <label class="col-md-3  control-label mb10" for="name"><span class="text-danger mr5">*</span>红包名称</label>
                                        <div class="col-md-9 mb10">
                                            <input type="text" class="form-control pull-right" name="name" id="name">
                                        </div>
                                    </div>
                                    <div class="form-group mbn">
                                        <label class="col-md-3  control-label mb10" for="bonus"><span class="text-danger mr5">*</span>红包金额</label>
                                        <div class="col-md-9 mb10">
                                            <input type="text" class="form-control pull-right" name="bonus" id="bonus">
                                        </div>
                                    </div>
                                    <div class="form-group mbn">
                                        <label class="col-md-3  control-label mb10" for="minInvestAmount"><span class="text-danger mr5">*</span>最小投标额</label>
                                        <div class="col-md-9 mb10">
                                            <input type="text" class="form-control pull-right" name="minInvestAmount" id="minInvestAmount">
                                        </div>
                                    </div>
                                    <div class="form-group mbn">
                                        <label class="col-md-3 control-label mb10" for="eventType">红包类型</label>
                                        <div class="col-md-9 mb10">
                                            <label class="field select">
                                                <select id="eventType" name="eventType">
                                                    <c:forEach items="${RewardEventType}" var="type">
                                                        <option value="${type}">${type.key}</option>
                                                    </c:forEach>
                                                </select>
                                                <i class="arrow"></i>
                                            </label>
                                        </div>
                                    </div>
                                    <div class="form-group mbn">
                                        <label class="col-md-3 control-label mb10" for="availableTime"><span class="text-danger mr5">*</span>发放开始日期</label>
                                        <div class="col-md-9 mb10">
                                            <label for="availableTime" class="field prepend-icon">
                                                <input type="text" id="availableTime" name="availableTime" class="gui-input" placeholder="Datepicker Popup">
                                                <label class="field-icon"><i class="fa fa-calendar-o"></i>
                                                </label>
                                            </label>
                                        </div>
                                    </div>
                                    <div class="form-group mbn">
                                        <label class="col-md-3 control-label mb10" for="expiredTime"><span class="text-danger mr5">*</span>发放截止日期</label>
                                        <div class="col-md-9 mb10">
                                            <label for="expiredTime" class="field prepend-icon">
                                                <input type="text" id="expiredTime" name="expiredTime" class="gui-input" placeholder="Datepicker Popup">
                                                <label class="field-icon"><i class="fa fa-calendar-o"></i>
                                                </label>
                                            </label>
                                        </div>
                                    </div>
                                    <div class="form-group mbn">
                                        <label class="col-md-3  control-label mb10" for="expiredDays"><span class="text-danger mr5">*</span>红包失效天数</label>
                                        <div class="col-md-9 mb10">
                                            <input type="text" class="form-control pull-right" name="expiredDays" id="expiredDays" value="30">
                                        </div>
                                    </div>
                                </form>
                                <div class="mt15 mb15 row">
                                    <div class="col-xs-3"></div>
                                    <div class="col-xs-9">
                                        <button type="button" class="btn btn-primary btn-block" id="save_coupon"><i class="fa fa-check mr10"></i>保存红包</button>
                                    </div>
                                </div>
                                <div class="text-right">
                                    <a href="coupon/list">返回红包列表</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                <!-- 页面内容结束 -->

            </section>
        </div>
        <!-- 主体内容结束 -->

        <!-- 公共函数 -->
        <%@include file="../common/scripts.jspf" %>
        <script type="text/javascript" src="${rootPath}/js/admin-tools/admin-forms/js/jquery.validate.min.js"></script>
        <script type="text/javascript" src="${rootPath}/js/admin-tools/admin-forms/js/additional-methods.min.js"></script>
        <script src="${rootPath}/js/admin-tools/admin-forms/js/jquery-ui-timepicker.min.js"></script>
        <script src="${rootPath}/js/admin-tools/admin-forms/js/lang/jquery-ui-timepicker-zh.js"></script>
        <script type="text/javascript" src="${rootPath}/js/pages/coupon/edit.js"></script>
    </body>
</html>